#include <iostream>
#include <vector>

// 检查一个数是否可以分解为连续整数序列的和
bool isDecomposable(int num) {
    for (int length = 3; length <= num; ++length) {
        int start = 0;
        while (start * length + length * (length - 1) / 2 <= num) {
            int sum_val = start * length + length * (length - 1) / 2;
            if (sum_val == num) {
                return true;
            }
            ++start;
        }
    }
    return false;
}

int main() {
    int n;
    std::cin >> n;

    std::vector<int> nums(n);
    for (int i = 0; i < n; ++i) {
        std::cin >> nums[i];
    }

    int count = 0;
    for (int num : nums) {
        if (isDecomposable(num)) {
            ++count;
        }
    }

    std::cout << count << std::endl;
    return 0;
}